/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/*************************************************************************
 *\author: starlove
 *************************************************************************/
#ifndef __CC_PYTHON_IMPORT_O_LAYER_IMPL__
#define __CC_PYTHON_IMPORT_O_LAYER_IMPL__

#include "python_object_layer.h"
#include "python_object_touch.h"
NS_CCPY_BEGIN
	CCLAYER_OBJECT_WRAPPER_IMPL(CCLayer, CPyLayer)	

	PYCLASS_INIT_AND_BASE_4(CPyLayer, CPyNode, CPyTouchDelegate, CPyAccelerometerDelegate, CPyKeypadDelegate, "CCLayer", "Python CCLayer Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyLayer)
    PYCLASS_ADD_METHOD(CPyLayer, registerWithTouchDispatcher)
	PYCLASS_END_METHOD_DEF(CPyLayer)
	PYCLASS_BEGIN_GETSET_DEF(CPyLayer)
    PYCLASS_ADD_GETSET(CPyLayer, TouchEnabled)
    PYCLASS_ADD_GETSET(CPyLayer, TouchMode)
    PYCLASS_ADD_GETSET(CPyLayer, TouchPriority)
    PYCLASS_ADD_GETSET(CPyLayer, AccelerometerEnabled)
    PYCLASS_ADD_GETSET(CPyLayer, KeypadEnabled)
    PYCLASS_ADD_SET(CPyLayer, AccelerometerInterval)
	PYCLASS_END_GETSET_DEF(CPyLayer)
	PYCLASS_IMP_INTERFACE(CPyLayer)
	    
	PYCLASS_METHOD_IMPL(CPyLayer, registerWithTouchDispatcher)
	{
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayer *, CPyLayer, registerWithTouchDispatcher);
		Py_RETURN_NONE;
	}
    PYCLASS_GET_IMPL(CPyLayer, TouchEnabled)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayer *, CPyLayer, isTouchEnabled, bool);
		Py_RETURN_BOOL(v);
	}
    PYCLASS_SET_IMPL(CPyLayer, TouchEnabled)
	{
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayer *, CPyLayer, setTouchEnabled, pyValue == Py_True);
		return 0;
	}
    PYCLASS_GET_IMPL(CPyLayer, TouchMode)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayer *, CPyLayer, getTouchMode, int);
		return Py_BuildValue("i", v);
	}
    PYCLASS_SET_IMPL(CPyLayer, TouchMode)
	{
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayer *, CPyLayer, setTouchMode, static_cast<cocos2d::ccTouchesMode>(PyLong_AsLong(pyValue)));
		return 0;
	}
    PYCLASS_GET_IMPL(CPyLayer, TouchPriority)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayer *, CPyLayer, getTouchPriority, int);
		return Py_BuildValue("i", v);
	}
    PYCLASS_SET_IMPL(CPyLayer, TouchPriority)
	{
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayer *, CPyLayer, setTouchPriority, PyLong_AsLong(pyValue));
		return 0;
	}
    PYCLASS_GET_IMPL(CPyLayer, AccelerometerEnabled)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayer *, CPyLayer, isAccelerometerEnabled, bool);
		Py_RETURN_BOOL(v);
	}
    PYCLASS_SET_IMPL(CPyLayer, AccelerometerEnabled)
	{
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayer *, CPyLayer, setAccelerometerEnabled, pyValue == Py_True);
		return 0;
	}
    PYCLASS_GET_IMPL(CPyLayer, KeypadEnabled)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayer *, CPyLayer, isKeypadEnabled, bool);
		Py_RETURN_BOOL(v);
	}
    PYCLASS_SET_IMPL(CPyLayer, KeypadEnabled)
	{
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayer *, CPyLayer, setKeypadEnabled, pyValue == Py_True);
		return 0;
	}
    PYCLASS_SET_IMPL(CPyLayer, AccelerometerInterval)
	{
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayer *, CPyLayer, setAccelerometerInterval, PyFloat_AsDouble(pyValue));
		return 0;
	}

	//////////////////////////////////////////////////////////
	
	CCLAYER_OBJECT_WRAPPER_IMPL(CCLayerRGBA, CPyLayerRGBA)	

	PYCLASS_INIT_AND_BASE_2(CPyLayerRGBA, CPyLayer, CPyRGBAProtocol, "CCLayerRGBA", "Python CCLayerRGBA Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyLayerRGBA)
	PYCLASS_END_METHOD_DEF(CPyLayerRGBA)
	PYCLASS_BEGIN_GETSET_DEF(CPyLayerRGBA)
	PYCLASS_END_GETSET_DEF(CPyLayerRGBA)
	PYCLASS_IMP_INTERFACE(CPyLayerRGBA)

	//////////////////////////////////////////////////////////
	
	CCLAYER_OBJECT_WRAPPER_IMPL(CCLayerColor, CPyLayerColor)	

	PYCLASS_INIT_AND_BASE_2(CPyLayerColor, CPyLayerRGBA, CPyBlendProtocol, "CCLayerColor", "Python CCLayerColor Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyLayerColor)
    PYCLASS_ADD_METHOD_EX(CPyLayerColor, initWithColor, METH_KEYWORDS|METH_VARARGS)
    PYCLASS_ADD_METHOD(CPyLayerColor, changeWidth)
    PYCLASS_ADD_METHOD(CPyLayerColor, changeHeight)
    PYCLASS_ADD_METHOD(CPyLayerColor, changeWidthAndHeight)
	PYCLASS_END_METHOD_DEF(CPyLayerColor)
	PYCLASS_BEGIN_GETSET_DEF(CPyLayerColor)
	PYCLASS_END_GETSET_DEF(CPyLayerColor)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyLayerColor)
	
	int CPyLayerColor::__init__(CPyLayerColor *pySelf, PyObject *pyArgs, PyObject *pyKW)
	{
		if( !pyArgs )
			return 0;
		static char* kwlist[] = {"color", "width", "height", NULL};
		PyObject *color = NULL;
		float w = -1;
		float h = -1;
		if(!PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"|Off",kwlist, &color, &w, &h))
			return 0;
		if(!color || !PyObject_TypeCheck(color, CPyClassBase::GetTypeObject<CPyColor4B>()))
			return 0;
		CPyColor4B *pycol = (CPyColor4B *)color;
		if(w >= 0 && h >= 0)
		{
			CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerColor *, CPyLayerColor, initWithColor, bool, pycol->getCCObject(), w, h);
		}else
		{
			CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerColor *, CPyLayerColor, initWithColor, bool, pycol->getCCObject());
		}
		return 0;
	}
	
    PYCLASS_METHOD_KW_IMPL(CPyLayerColor, initWithColor)
	{
		if( !pyArgs )
			Py_RETURN_FALSE;
		static char* kwlist[] = {"color", "width", "height", NULL};
		PyObject *color = NULL;
		float w = -1;
		float h = -1;
		if(!PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"O|ff",kwlist, &color, &w, &h))
			Py_RETURN_FALSE;
		if(!PyObject_TypeCheck(color, CPyClassBase::GetTypeObject<CPyColor4B>()))
			Py_RETURN_FALSE;
		CPyColor4B *pycol = (CPyColor4B *)color;
		if(w >= 0 && h >= 0)
		{
			CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerColor *, CPyLayerColor, initWithColor, bool, pycol->getCCObject(), w, h);
			Py_RETURN_BOOL(v);
		}else
		{			
			CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerColor *, CPyLayerColor, initWithColor, bool, pycol->getCCObject());
			Py_RETURN_BOOL(v);
		}
		Py_RETURN_FALSE;
	}

    PYCLASS_METHOD_IMPL(CPyLayerColor, changeWidth)
	{
		float f = 0;
		if( !PyArg_ParseTuple(pyArgs, "f", &f) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerColor *, CPyLayerColor, changeWidth, f);		
		Py_RETURN_NONE;
	}

    PYCLASS_METHOD_IMPL(CPyLayerColor, changeHeight)
	{
		float f = 0;
		if( !PyArg_ParseTuple(pyArgs, "f", &f) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerColor *, CPyLayerColor, changeHeight, f);		
		Py_RETURN_NONE;
	}

    PYCLASS_METHOD_IMPL(CPyLayerColor, changeWidthAndHeight)
	{
		float fw = 0;
		float fh = 0;
		if( !PyArg_ParseTuple(pyArgs, "ff", &fw, &fh) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerColor *, CPyLayerColor, changeWidthAndHeight, fw, fh);		
		Py_RETURN_NONE;
	}

	//////////////////////////////////////////////////////////
	
	CCLAYER_OBJECT_WRAPPER_IMPL(CCLayerGradient, CPyLayerGradient)	

	PYCLASS_INIT_AND_BASE(CPyLayerGradient, CPyLayerColor, "CCLayerGradient", "Python CCLayerGradient Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyLayerGradient)
    PYCLASS_ADD_METHOD_EX(CPyLayerGradient, initWithColor, METH_KEYWORDS|METH_VARARGS)
    PYCLASS_ADD_METHOD(CPyLayerGradient, changeWidth)
    PYCLASS_ADD_METHOD(CPyLayerGradient, changeHeight)
    PYCLASS_ADD_METHOD(CPyLayerGradient, changeWidthAndHeight)
	PYCLASS_END_METHOD_DEF(CPyLayerGradient)
	PYCLASS_BEGIN_GETSET_DEF(CPyLayerGradient)
	PYCLASS_ADD_GETSET(CPyLayerGradient, StartColor)
	PYCLASS_ADD_GETSET(CPyLayerGradient, EndColor)
	PYCLASS_ADD_GETSET(CPyLayerGradient, StartOpacity)
	PYCLASS_ADD_GETSET(CPyLayerGradient, EndOpacity)
	PYCLASS_ADD_GETSET(CPyLayerGradient, Vector)
	PYCLASS_ADD_GETSET(CPyLayerGradient, CompressedInterpolation)
	PYCLASS_END_GETSET_DEF(CPyLayerGradient)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyLayerGradient)
		
	int CPyLayerGradient::__init__(CPyLayerGradient *pySelf, PyObject *pyArgs, PyObject *pyKW)
	{
		if( !pyArgs )
			return 0;
		static char* kwlist[] = {"start", "end", "v", NULL};
		PyObject *pstart = NULL;
		PyObject *pend = NULL;
		PyObject *pv = NULL;
		if(!PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"|OOO",kwlist, &pstart, &pend, &pv))
			return 0;
		if(!pstart || !PyObject_TypeCheck(pstart, CPyClassBase::GetTypeObject<CPyColor4B>()))
			return 0;
		if(!pend || !PyObject_TypeCheck(pend, CPyClassBase::GetTypeObject<CPyColor4B>()))
			return 0;
		CPyColor4B *start = (CPyColor4B *)pstart;
		CPyColor4B *end = (CPyColor4B *)pend;
		CPyPoint *pt = NULL;
		if(end && PyObject_TypeCheck(pv, CPyClassBase::GetTypeObject<CPyPoint>()))
			pt = (CPyPoint *)pv;
		if(pt)
		{
			CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, initWithColor, bool, start->getCCObject(), end->getCCObject(), pt->getCCObject());
		}else
		{
			CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, initWithColor, bool, start->getCCObject(), end->getCCObject());
		}
		return 0;
	}
	
    PYCLASS_METHOD_KW_IMPL(CPyLayerGradient, initWithColor)
	{
		if( !pyArgs )
			return 0;
		static char* kwlist[] = {"start", "end", "v", NULL};
		PyObject *pstart = NULL;
		PyObject *pend = NULL;
		PyObject *pv = NULL;
		if(!PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"|OOO",kwlist, &pstart, &pend, &pv))
			return 0;
		if(!pstart || !PyObject_TypeCheck(pstart, CPyClassBase::GetTypeObject<CPyColor4B>()))
			return 0;
		if(!pend || !PyObject_TypeCheck(pend, CPyClassBase::GetTypeObject<CPyColor4B>()))
			return 0;
		CPyColor4B *start = (CPyColor4B *)pstart;
		CPyColor4B *end = (CPyColor4B *)pend;
		CPyPoint *pt = NULL;
		if(end && PyObject_TypeCheck(pv, CPyClassBase::GetTypeObject<CPyPoint>()))
			pt = (CPyPoint *)pv;
		if(pt)
		{
			CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, initWithColor, bool, start->getCCObject(), end->getCCObject(), pt->getCCObject());
		}else
		{
			CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, initWithColor, bool, start->getCCObject(), end->getCCObject());
		}
		return 0;
	}

    PYCLASS_METHOD_IMPL(CPyLayerGradient, changeWidth)
	{
		float f = 0;
		if( !PyArg_ParseTuple(pyArgs, "f", &f) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerGradient *, CPyLayerGradient, changeWidth, f);		
		Py_RETURN_NONE;
	}

    PYCLASS_METHOD_IMPL(CPyLayerGradient, changeHeight)
	{
		float f = 0;
		if( !PyArg_ParseTuple(pyArgs, "f", &f) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerGradient *, CPyLayerGradient, changeHeight, f);		
		Py_RETURN_NONE;
	}

    PYCLASS_METHOD_IMPL(CPyLayerGradient, changeWidthAndHeight)
	{
		float fw = 0;
		float fh = 0;
		if( !PyArg_ParseTuple(pyArgs, "ff", &fw, &fh) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerGradient *, CPyLayerGradient, changeWidthAndHeight, fw, fh);		
		Py_RETURN_NONE;
	}

	PYCLASS_GET_IMPL(CPyLayerGradient, StartColor)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerGradient *, CPyLayerGradient, getStartColor, cocos2d::ccColor3B);
		CPyColor3B *col = CPyColor3B::create(v);
		return (PyObject *)col;
	}

	PYCLASS_SET_IMPL(CPyLayerGradient, StartColor)
	{
		if(!pyValue || !PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyColor3B>()))
			return 0;
		CPyColor3B *col = (CPyColor3B *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, setStartColor, col->getCCObject());
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyLayerGradient, EndColor)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerGradient *, CPyLayerGradient, getEndColor, cocos2d::ccColor3B);
		CPyColor3B *col = CPyColor3B::create(v);
		return (PyObject *)col;
	}

	PYCLASS_SET_IMPL(CPyLayerGradient, EndColor)
	{
		if(!pyValue || !PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyColor3B>()))
			return 0;
		CPyColor3B *col = (CPyColor3B *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, setEndColor, col->getCCObject());
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyLayerGradient, StartOpacity)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerGradient *, CPyLayerGradient, getStartOpacity, GLubyte);		
		return Py_BuildValue("I", v);
	}

	PYCLASS_SET_IMPL(CPyLayerGradient, StartOpacity)
	{
		GLubyte opa = (GLubyte)PyLong_AsUnsignedLong(pyValue);
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, setStartOpacity, opa);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyLayerGradient, EndOpacity)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerGradient *, CPyLayerGradient, getEndOpacity, GLubyte);		
		return Py_BuildValue("I", v);
	}

	PYCLASS_SET_IMPL(CPyLayerGradient, EndOpacity)
	{
		GLubyte opa = (GLubyte)PyLong_AsUnsignedLong(pyValue);
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, setEndOpacity, opa);
		return 0;
	}
		
	PYCLASS_GET_IMPL(CPyLayerGradient, Vector)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerGradient *, CPyLayerGradient, getVector, cocos2d::CCPoint);
		CPyPoint *pt = CPyPoint::create(v);
		return (PyObject *)pt;
	}

	PYCLASS_SET_IMPL(CPyLayerGradient, Vector)
	{
		if(!pyValue || !PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyPoint>()))
			return 0;
		CPyPoint *pt = (CPyPoint *)pyValue;
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, setVector, pt->getCCObject());
		return 0;
	}

	PYCLASS_GET_IMPL(CPyLayerGradient, CompressedInterpolation)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCLayerGradient *, CPyLayerGradient, isCompressedInterpolation, bool);		
		Py_RETURN_BOOL(v);
	}

	PYCLASS_SET_IMPL(CPyLayerGradient, CompressedInterpolation)
	{
		bool b = pyValue == Py_True;
		CC_METHOD_WRAPPER_SETER_RINT(cocos2d::CCLayerGradient *, CPyLayerGradient, setCompressedInterpolation, b);
		return 0;
	}

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	CCLAYER_OBJECT_WRAPPER_IMPL(CCLayerMultiplex, CPyLayerMultiplex)	

	PYCLASS_INIT_AND_BASE(CPyLayerMultiplex, CPyLayer, "CCLayerMultiplex", "Python CCLayerMultiplex Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyLayerMultiplex)
		PYCLASS_ADD_METHOD(CPyLayerMultiplex, initWithLayers)
		PYCLASS_ADD_METHOD(CPyLayerMultiplex, addLayer)
		PYCLASS_ADD_METHOD(CPyLayerMultiplex, switchTo)
		PYCLASS_ADD_METHOD(CPyLayerMultiplex, switchToAndReleaseMe)
	PYCLASS_END_METHOD_DEF(CPyLayerMultiplex)
	PYCLASS_BEGIN_GETSET_DEF(CPyLayerMultiplex)
	PYCLASS_END_GETSET_DEF(CPyLayerMultiplex)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyLayerMultiplex)
	
	int CPyLayerMultiplex::__init__(CPyLayerMultiplex *pySelf, PyObject *pyArgs, PyObject *pyKW)
	{
		if( !pyArgs )
			return 0;
		static char* kwlist[] = {"O", NULL};
		PyObject *players = NULL;
		if(!PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"|O",kwlist, &players))
			return 0;
		if(!players || PySequence_Check(players))
			return 0;
		Py_ssize_t ac = PySequence_Size(players);
		cocos2d::CCArray *arr = cocos2d::CCArray::create();
		for(Py_ssize_t i = 0; i < ac; i ++)
		{
			CPyCCObject *obj = (CPyCCObject *)PySequence_GetItem(players, i);
			arr->addObject(obj->getCCObject());
			//Py_XDECREF(obj);
		}
		CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerMultiplex *, CPyLayerMultiplex, initWithArray, bool, arr);
		return 0;
	}
	
    PYCLASS_METHOD_IMPL(CPyLayerMultiplex, initWithLayers)
	{
		if( !pyArgs )
			Py_RETURN_FALSE;
		static char* kwlist[] = {"O", NULL};
		PyObject *players = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &players) )
			Py_RETURN_FALSE;
		if(!players || PySequence_Check(players))
			Py_RETURN_FALSE;
		Py_ssize_t ac = PySequence_Size(players);
		cocos2d::CCArray *arr = cocos2d::CCArray::create();
		for(Py_ssize_t i = 0; i < ac; i ++)
		{
			CPyCCObject *obj = (CPyCCObject *)PySequence_GetItem(players, i);
			arr->addObject(obj->getCCObject());
			//Py_XDECREF(obj);
		}
		CC_METHOD_WRAPPER_GETER_RINT(cocos2d::CCLayerMultiplex *, CPyLayerMultiplex, initWithArray, bool, arr);
		Py_RETURN_TRUE;
	}
	
	PYCLASS_METHOD_IMPL(CPyLayerMultiplex, addLayer)
	{
		PyObject *pyValue = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pyValue) )
			Py_RETURN_NONE;
		CPyLayer *l = (CPyLayer *)pyValue;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerMultiplex *, CPyLayerMultiplex, addLayer, (cocos2d::CCLayer *)l->getCCObject());
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyLayerMultiplex, switchTo)
	{
		unsigned int i = 0;
		if( !PyArg_ParseTuple(pyArgs, "I", &i) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerMultiplex *, CPyLayerMultiplex, switchTo, i);
		Py_RETURN_NONE;
	}

	PYCLASS_METHOD_IMPL(CPyLayerMultiplex, switchToAndReleaseMe)
	{
		unsigned int i = 0;
		if( !PyArg_ParseTuple(pyArgs, "I", &i) )
			Py_RETURN_NONE;
		CC_METHOD_WRAPPER_SETER(cocos2d::CCLayerMultiplex *, CPyLayerMultiplex, switchToAndReleaseMe, i);
		Py_RETURN_NONE;
	}

NS_CCPY_END

#endif